package com.mht.book.entity.user;

import com.mht.book.operation.Operations;
import com.mht.book.operation.impl.*;

import java.util.Scanner;

/**
 * @author wangfusheng
 * @version 1.0.0
 * @ClassName NormalUser.java
 * @Description TODO
 * @createTime 2022/12/312:24
 */

/**
 * 1.查询图书
 * 2.展示图书
 * 3.借阅图书
 * 4.归还图书
 * 5.退出系统
 */
public class NormalUser extends User{
    public NormalUser(String name) {
        super(name);
        ops = new Operations[]{
                new FindOperation(),
                new ShowBooksOperation(),
                new BorrowOperation(),
                new BackBookOperation(),
                new ExitOperation()
        };
    }
    @Override
    public int menu() {
        System.out.println("========================================");
        System.out.println("欢迎 "+this.name+" 使用图书管理系统");
        System.out.println();
        System.out.println("1.查询图书");
        System.out.println("2.展示图书");
        System.out.println("3.借阅图书");
        System.out.println("4.归还图书");
        System.out.println("5.退出系统");
        System.out.println("请输入您要进行的操作: ->");
        Scanner sc = new Scanner(System.in);
        int choice = sc.nextInt();
        System.out.println("==========================================");
        return choice;
    }
}
